from sklearn.metrics import mean_absolute_error
import numpy as np


def mae_score_metrics(ori_data, generated_data):
    # [n_sample, seq_len, feature_dim]
    # feature_dim = ori_data.shape[-1]
    # ori_data = ori_data[:, :, 1:].reshape(-1, feature_dim)  # 不要第一个维度，即水温
    # generated_data = generated_data[:, :, 1:].reshape(-1, feature_dim)

    ori_data = ori_data[:, :, -1].reshape(-1, 1)  # todo 只要最后一个维度
    generated_data = generated_data[:, :, -1].reshape(-1, 1)

    return mean_absolute_error(ori_data, generated_data)
